Typically, data stored in a storage subsystem is accessed by a file system, which is usually associated with an operating system such as Unix, DOS, Microsoft WINDOWS®, Mac OS, and so forth. Software, such as application software, in a computer can access data stored in the storage subsystem through the file system. There are generally two types of requests that can be issued by application software or other software for data stored in the storage subsystem: cached input/output (I/O) requests and direct I/O requests. In response to a cached I/O request, the file system performs a speculative read-ahead operation to retrieve read-ahead data (in addition to the data requested by the cached I/O request). The read-ahead data is stored in an operating system buffer cache maintained by the operating system.
The speculative read-ahead operation is generally performed to pre-populate the operating system buffer cache with data. If a subsequent request from the application software can be satisfied from the operating system buffer cache, then system performance is enhanced since the data can be retrieved more quickly from the operating system buffer cache than from the storage subsystem, which is usually implemented with relatively slow mass storage devices such as disk drives and the like.
In contrast, for a direct I/O request, a conventional file system does not cache data in the operating system buffer cache. For direct I/O requests, read-ahead is not performed to pre-populate the operating system buffer cache. Direct I/O requests are used by certain types of applications to avoid the expense associated with buffering data in the operating system buffer cache.
Generally, software applications have to choose between using either direct I/O or cached I/O requests. If direct I/O is chosen, speculative read-ahead is not performed so that any subsequent requests for data will result in access of the slower storage devices in the storage subsystem, since read ahead was not performed for caching read-ahead data.